package com.huaju.enity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * Incomelist entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "incomelist", catalog = "licai")
public class Incomelist implements java.io.Serializable {

	// Fields

	private Integer iid;
	private Integer comId;
	private Account account;
	private Incometype incometype;
	private Date itime;
	private String idesc;
	private Double imoney;
	private Short success;
	private Date successTime;
	private String moneyStr;

	// Constructors

	/** default constructor */
	public Incomelist() {
	}

	/** full constructor */
	public Incomelist(Account account, Incometype incometype, Date itime,
			String idesc, Double imoney, Short success, Date successTime) {
		this.account = account;
		this.incometype = incometype;
		this.itime = itime;
		this.idesc = idesc;
		this.imoney = imoney;
		this.success = success;
		this.successTime = successTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "iid", unique = true, nullable = false)
	public Integer getIid() {
		return this.iid;
	}

	public void setIid(Integer iid) {
		this.iid = iid;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "aid")
	public Account getAccount() {
		return this.account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "itype")
	public Incometype getIncometype() {
		return this.incometype;
	}

	public void setIncometype(Incometype incometype) {
		this.incometype = incometype;
	}

	@Column(name = "itime", length = 19)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss" ) 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss" ,timezone = "GMT+8")
	public Date getItime() {
		return this.itime;
	}

	public void setItime(Date itime) {
		this.itime = itime;
	}

	@Column(name = "idesc")
	public String getIdesc() {
		return this.idesc;
	}

	public void setIdesc(String idesc) {
		this.idesc = idesc;
	}

	@Column(name = "imoney", precision = 10)
	public Double getImoney() {
		return this.imoney;
	}

	public void setImoney(Double imoney) {
		this.imoney = imoney;
	}

	@Column(name = "success")
	public Short getSuccess() {
		return this.success;
	}

	public void setSuccess(Short success) {
		this.success = success;
	}

	@Column(name = "successTime", length = 19)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss" ) 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss" ,timezone = "GMT+8")
	public Date getSuccessTime() {
		return this.successTime;
	}

	public void setSuccessTime(Date successTime) {
		this.successTime = successTime;
	}

	public Integer getComId() {
		return comId;
	}

	public void setComId(Integer comId) {
		this.comId = comId;
	}

	public String getMoneyStr() {
		return moneyStr;
	}

	public void setMoneyStr(String moneyStr) {
		this.moneyStr = moneyStr;
	}

}